class Solution {//寻找旋转排序数组的最小值
public:
    int findMin(vector<int>& nums) {
        int left=0,right=nums.size()-1;
        int n=right;
        while(left<right){
            int mid=(right-left)/2+left;
            if(nums[mid]<nums[n]) right=mid;
            else left=mid+1;
        }
        return nums[left];
    }
};